package system;

import com.alibaba.fastjson.JSON;
import listTest.User;

import java.util.Properties;
import java.util.Set;

public class SystemTest {
    public static void main(String[] args) {
        systemTest();
    }

    public static void systemTest() {
        System.getenv("分界线");
        System.out.println(" =-=-=-=-=-=-=-=-=-=-=-=-=--=");
        System.console();
        String[] arr = new String[]{"分界线", "两女两亭", "谭婷婷"};
        String[] arrCopy = new String[]{"张三", "李四", "王五", "赵六"};
        //复制一个数组从0的位置开始复制到arrCopy的1的位置复制3个
        System.arraycopy(arr, 0, arrCopy, 1, 3);
        for (String s : arrCopy) {
            System.out.println(s);
        }
        //终止java虚拟机所有程序也终止了,后面的不会执行了
        //System.exit(0);
        //获取系统属性
        System.out.println(System.getProperty("java.vendor"));
        //获取当前系统的时间是毫秒格式,返回类型是Long
        //native修饰的方法就是本地方法(方法不是jdk写的是用其它语言写的C或者C++)
        long l = System.currentTimeMillis();
        System.out.println(l);
        Long x = 0L;
        for (int i = 0; i < 10000; i++) {
            User user = new User();
            x = x + i;

        }
        System.out.println(x);
        Properties properties = System.getProperties();
        Set<Object> objects = properties.keySet();
        for (Object obj : objects) {
            System.out.println("key==" + obj + ",值==" + properties.get(obj));

        }


        long l1 = System.currentTimeMillis();

        System.out.println(l1 - l);
        System.out.println(objects);
        Object m=null;




    }
}
